<template>
  <div class="skills-page">
    <!-- 页面标题 -->
    <div class="page-header">
      <h1 class="page-title">技能图鉴 (表格版本)</h1>
      <p class="page-subtitle">探索所有宝可梦技能的详细信息</p>
    </div>
    
    <!-- 搜索和筛选区域 -->
    <div class="search-filter-section">
      <!-- 搜索栏 -->
      <div class="search-bar">
        <div class="search-type-selector">
          <el-radio-group v-model="searchType" size="large" @change="handleSearchTypeChange">
            <el-radio-button value="skill">技能名称</el-radio-button>
            <el-radio-button value="pokemon">宝可梦ID</el-radio-button>
          </el-radio-group>
        </div>
        
        <el-input
          v-model="searchQuery"
          :placeholder="searchType === 'skill' ? '搜索技能名称...' : '输入宝可梦ID...'"
          size="large"
          clearable
          @input="handleSearch"
          @clear="handleSearch"
          @keyup.enter="handleSearch"
          class="search-input"
        >
          <template #prefix>
            <el-icon><Search /></el-icon>
          </template>
        </el-input>
        
        <el-button 
          type="primary" 
          size="large" 
          @click="handleSearch"
          :loading="loading"
          class="search-btn"
        >
          搜索
        </el-button>
      </div>
      
      <!-- 筛选器 -->
      <div class="filters">
        <!-- 属性筛选 -->
        <div class="filter-group">
          <label class="filter-label">属性:</label>
          <el-select
            v-model="selectedType"
            placeholder="所有属性"
            size="large"
            clearable
            @change="handleFilter"
          >
            <el-option label="所有属性" value="" />
            <el-option
              v-for="type in skillTypes"
              :key="type"
              :label="type"
              :value="type"
            />
          </el-select>
        </div>
        
        <!-- 分类筛选 -->
        <div class="filter-group">
          <label class="filter-label">分类:</label>
          <el-select
            v-model="selectedCategory"
            placeholder="所有分类"
            size="large"
            clearable
            @change="handleFilter"
          >
            <el-option label="所有分类" value="" />
            <el-option label="物理" value="物理" />
            <el-option label="特殊" value="特殊" />
            <el-option label="变化" value="变化" />
          </el-select>
        </div>
        
        <!-- 排序方式 -->
        <div class="filter-group">
          <label class="filter-label">排序:</label>
          <el-select
            v-model="sortBy"
            size="large"
            @change="handleSort"
          >
            <el-option label="按编号排序" value="id" />
            <el-option label="按威力排序" value="power" />
            <el-option label="按名称排序" value="name" />
            <el-option label="按命中率排序" value="accuracy" />
          </el-select>
        </div>
        
        <!-- 重置按钮 -->
        <el-button @click="resetFilters" size="large" type="info" class="reset-info-btn">
          <el-icon><RefreshLeft /></el-icon>
          重置
        </el-button>
      </div>
    </div>
    
    <!-- 结果统计 -->
    <div class="result-info" v-if="!loading">
      <span class="result-count">
        共找到 <strong>{{ totalCount }}</strong> 个技能
      </span>
      <span class="current-showing" v-if="filteredSkillsList.length > 0">
        当前显示第 {{ (currentPage - 1) * pageSize + 1 }} - {{ Math.min(currentPage * pageSize, filteredSkillsList.length) }} 个
      </span>
      <span class="search-info" v-if="searchQuery && searchType === 'pokemon'">
        <el-tag type="success" size="large">宝可梦ID: {{ searchQuery }}</el-tag>
      </span>
    </div>
    
    <!-- 技能表格 -->
    <div class="skills-table-container" v-loading="loading">
      <el-table 
        :data="paginatedSkillsList" 
        style="width: 100%" 
        height="600"
        @row-click="showSkillDetail"
        class="skills-table"
        stripe
        border
      >
        <!-- 编号列 - 固定 -->
        <el-table-column 
          fixed 
          prop="id" 
          label="编号" 
          width="80" 
          align="center"
          sortable
        />
        
        <!-- 中文名 - 固定 -->
        <el-table-column 
          fixed
          prop="moveName" 
          label="中文名" 
          width="120"
          show-overflow-tooltip
        >
          <template #default="{ row }">
            <div class="skill-name-cell">
              <span class="skill-name-text">{{ row.moveName }}</span>
            </div>
          </template>
        </el-table-column>
        
        <!-- 日文名 -->
        <el-table-column 
          prop="japaneseMoveName" 
          label="日文名" 
          width="140"
          show-overflow-tooltip
        >
          <template #default="{ row }">
            <span class="japanese-name">{{ row.japaneseMoveName || '-' }}</span>
          </template>
        </el-table-column>
        
        <!-- 英文名 -->
        <el-table-column 
          prop="englishMoveName" 
          label="英文名" 
          width="140"
          show-overflow-tooltip
        >
          <template #default="{ row }">
            <span class="english-name">{{ row.englishMoveName || '-' }}</span>
          </template>
        </el-table-column>
        
        <!-- 属性 -->
        <el-table-column 
          prop="typeName" 
          label="属性" 
          width="100"
          align="center"
        >
          <template #default="{ row }">
            <span 
              class="type-badge table-badge"
              :style="{ backgroundColor: row.typeColor || '#A8A878' }"
            >
              {{ row.moveType || row.typeName }}
            </span>
          </template>
        </el-table-column>
        
        <!-- 分类 -->
        <el-table-column 
          prop="category" 
          label="分类" 
          width="80"
          align="center"
        >
          <template #default="{ row }">
            <span 
              class="category-badge table-badge"
              :class="`category-${row.category}`"
            >
              {{ row.category }}
            </span>
          </template>
        </el-table-column>
        
        <!-- 威力 -->
        <el-table-column 
          prop="power" 
          label="威力" 
          width="80"
          align="center"
          sortable
        >
          <template #default="{ row }">
            <span class="power-value">{{ row.power || '—' }}</span>
          </template>
        </el-table-column>
        
        <!-- 命中 -->
        <el-table-column 
          prop="accuracy" 
          label="命中" 
          width="80"
          align="center"
          sortable
        >
          <template #default="{ row }">
            <span class="accuracy-value">{{ row.accuracy || '—' }}</span>
          </template>
        </el-table-column>
        
        <!-- PP -->
        <el-table-column 
          prop="pp" 
          label="PP" 
          width="70"
          align="center"
          sortable
        />
        
        <!-- 学习等级 -->
        <el-table-column 
          prop="learnLevel" 
          label="等级" 
          width="80"
          align="center"
          v-if="searchType === 'pokemon'"
        >
          <template #default="{ row }">
            <span class="learn-level" v-if="row.learnLevel">
              Lv.{{ row.learnLevel }}
            </span>
            <span class="no-level" v-else>—</span>
          </template>
        </el-table-column>
        
        <!-- 学习方式 -->
        <el-table-column 
          prop="learnMethod" 
          label="方式" 
          width="100"
          align="center"
          v-if="searchType === 'pokemon'"
        >
          <template #default="{ row }">
            <el-tag 
              v-if="row.learnMethod"
              :type="getLearnMethodTagType(row.learnMethod)"
              size="small"
            >
              {{ getLearnMethodText(row.learnMethod) }}
            </el-tag>
            <span v-else>—</span>
          </template>
        </el-table-column>
        
        <!-- 说明 -->
        <el-table-column 
          prop="description" 
          label="说明" 
          min-width="300"
          show-overflow-tooltip
        >
          <template #default="{ row }">
            <div class="description-cell">
              {{ row.description }}
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
    
    <!-- 空状态 -->
    <div v-if="!loading && filteredSkillsList.length === 0" class="empty-state">
      <div class="empty-icon">🔍</div>
      <h3>未找到技能</h3>
      <p v-if="searchType === 'pokemon' && searchQuery">
        宝可梦ID "{{ searchQuery }}" 没有找到相关技能
      </p>
      <p v-else>请尝试调整搜索条件或筛选器</p>
      <el-button @click="resetFilters" type="primary" class="reset-primary-btn">重置筛选</el-button>
    </div>
    
    <!-- 分页 -->
    <div class="pagination-section" v-if="filteredSkillsList.length > 0">
      <el-pagination
        :current-page="currentPage"
        :page-size="pageSize"
        :page-sizes="[12, 24, 48, 96]"
        :total="totalCount"
        layout="total, sizes, prev, pager, next, jumper"
        @current-change="handlePageChange"
        @size-change="handlePageSizeChange"
      />
    </div>
    
    <!-- 技能详情对话框 -->
    <el-dialog 
      v-model="dialogVisible" 
      :title="selectedSkill?.moveName || '技能详情'"
      width="600px"
      center
    >
      <div v-if="selectedSkill" class="skill-detail">
        <div class="detail-header">
          <div class="detail-basic">
            <h2 class="detail-name">{{ selectedSkill.moveName }}</h2>
            <div class="detail-types">
              <span 
                class="type-badge large"
                :class="`type-${selectedSkill.moveType || selectedSkill.typeName}`"
              >
                {{ selectedSkill.moveType || selectedSkill.typeName }}
              </span>
              <span 
                class="category-badge large"
                :class="`category-${selectedSkill.category}`"
              >
                {{ selectedSkill.category }}
              </span>
            </div>
          </div>
        </div>
        
        <div class="detail-description">
          <h4>技能描述</h4>
          <p>{{ selectedSkill.description }}</p>
        </div>
        
        <div class="detail-effect" v-if="selectedSkill.effect">
          <h4>附加效果</h4>
          <p>{{ selectedSkill.effect }}</p>
        </div>
        
        <div class="detail-stats">
          <div class="stat-row">
            <span class="stat-label">威力:</span>
            <span class="stat-value">{{ selectedSkill.power || '-' }}</span>
          </div>
          <div class="stat-row">
            <span class="stat-label">命中率:</span>
            <span class="stat-value">{{ selectedSkill.accuracy }}%</span>
          </div>
          <div class="stat-row">
            <span class="stat-label">PP:</span>
            <span class="stat-value">{{ selectedSkill.pp }}</span>
          </div>
          <div v-if="selectedSkill.learnLevel" class="stat-row">
            <span class="stat-label">学习等级:</span>
            <span class="stat-value">Lv.{{ selectedSkill.learnLevel }}</span>
          </div>
          <div v-if="selectedSkill.learnMethod" class="stat-row">
            <span class="stat-label">学习方式:</span>
            <span class="stat-value">{{ selectedSkill.learnMethod }}</span>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, reactive, computed, onMounted, watch } from 'vue'
// 移除了所有提示
import { Search, RefreshLeft } from '@element-plus/icons-vue'
import { getAllMoves, getMovesByPokemonId, getMockMovesList } from '@/api/moves.api'

// 响应式数据
const loading = ref(false)
const skillsList = ref([])
const filteredSkillsList = ref([])
const searchQuery = ref('')
const searchType = ref('skill') // 'skill' 或 'pokemon'
const selectedType = ref('')
const selectedCategory = ref('')
const sortBy = ref('id')
const currentPage = ref(1)
const pageSize = ref(24)
const dialogVisible = ref(false)
const selectedSkill = ref(null)

// 技能属性类型
const skillTypes = [
  '草', '火', '水', '电', '超能力', '冰', '龙', '恶', '妖精', 
  '格斗', '毒', '地面', '飞行', '虫', '岩石', '幽灵', '钢', '一般'
]

// 计算属性
const totalCount = computed(() => filteredSkillsList.value.length)

const paginatedSkillsList = computed(() => {
  const start = (currentPage.value - 1) * pageSize.value
  const end = start + pageSize.value
  return filteredSkillsList.value.slice(start, end)
})

// 获取技能数据
const fetchSkillsList = async () => {
  loading.value = true
  try {
    let response
    
    // 优先尝试从后端API获取数据
    try {
      response = await getAllMoves()
    } catch (apiError) {
      // 移除了控制台提示
      // 如果后端不可用，使用模拟数据
      response = await getMockMovesList()
    }
    
    if (response) {
      // 处理响应数据
      const newSkills = Array.isArray(response) ? response : (response.data || [])
      
      skillsList.value = newSkills
      filteredSkillsList.value = newSkills
      
      console.log(`成功获取 ${newSkills.length} 个技能数据`)
      // 成功加载技能
    } else {
      // 未获取到有效的技能数据
    }
  } catch (error) {
    // 获取技能列表失败
  } finally {
    loading.value = false
  }
}

// 根据宝可梦ID获取技能
const fetchSkillsByPokemonId = async (pokemonId) => {
  loading.value = true
  try {
    const response = await getMovesByPokemonId(pokemonId)
    
    if (response && response.data) {
      const skills = Array.isArray(response.data) ? response.data : []
      skillsList.value = skills
      filteredSkillsList.value = skills
      
      if (skills.length > 0) {
        // 找到宝可梦技能
      } else {
        // 没有找到技能数据
      }
    } else {
      // 未找到该宝可梦的技能信息
      skillsList.value = []
      filteredSkillsList.value = []
    }
  } catch (error) {
    // 查询宝可梦技能失败
    skillsList.value = []
    filteredSkillsList.value = []
  } finally {
    loading.value = false
  }
}

// 搜索类型改变处理
const handleSearchTypeChange = () => {
  searchQuery.value = ''
  resetFilters()
}

// 搜索处理
const handleSearch = () => {
  if (searchType.value === 'pokemon' && searchQuery.value.trim()) {
    const pokemonId = parseInt(searchQuery.value.trim())
    if (isNaN(pokemonId) || pokemonId <= 0) {
      // 请输入有效的宝可梦ID
      return
    }
    fetchSkillsByPokemonId(pokemonId)
  } else if (searchType.value === 'skill') {
    applyFilters()
  } else if (!searchQuery.value.trim()) {
    // 空搜索时重新加载所有技能
    fetchSkillsList()
  }
}

// 筛选处理
const handleFilter = () => {
  currentPage.value = 1
  applyFilters()
}

// 排序处理
const handleSort = () => {
  applyFilters()
}

// 应用筛选器
const applyFilters = () => {
  let filtered = [...skillsList.value]
  
  // 技能名称搜索筛选（仅在skill模式下）
  if (searchType.value === 'skill' && searchQuery.value.trim()) {
    const keyword = searchQuery.value.trim().toLowerCase()
    filtered = filtered.filter(skill => {
      const name = skill.moveName.toLowerCase()
      return name.includes(keyword)
    })
  }
  
  // 属性筛选
  if (selectedType.value) {
    filtered = filtered.filter(skill => 
      (skill.moveType === selectedType.value) || 
      (skill.typeName === selectedType.value)
    )
  }
  
  // 分类筛选
  if (selectedCategory.value) {
    filtered = filtered.filter(skill => skill.category === selectedCategory.value)
  }
  
  // 排序
  if (sortBy.value === 'id') {
    filtered.sort((a, b) => (a.id || 0) - (b.id || 0))
  } else if (sortBy.value === 'power') {
    filtered.sort((a, b) => {
      const powerA = parseInt(a.power || 0)
      const powerB = parseInt(b.power || 0)
      return powerB - powerA
    })
  } else if (sortBy.value === 'name') {
    filtered.sort((a, b) => {
      return a.moveName.localeCompare(b.moveName, 'zh-CN')
    })
  } else if (sortBy.value === 'accuracy') {
    filtered.sort((a, b) => {
      const accuracyA = parseInt(a.accuracy || 0)
      const accuracyB = parseInt(b.accuracy || 0)
      return accuracyB - accuracyA
    })
  }
  
  filteredSkillsList.value = filtered
}

// 重置筛选器
const resetFilters = () => {
  searchQuery.value = ''
  selectedType.value = ''
  selectedCategory.value = ''
  sortBy.value = 'id'
  currentPage.value = 1
  searchType.value = 'skill'
  
  // 重新获取所有技能
  fetchSkillsList()
}

// 分页处理
const handlePageChange = (page) => {
  currentPage.value = page
}

const handlePageSizeChange = (size) => {
  pageSize.value = size
  currentPage.value = 1
}

// 显示技能详情
const showSkillDetail = (skill) => {
  selectedSkill.value = skill
  dialogVisible.value = true
}

// 获取学习方式标签类型
const getLearnMethodTagType = (method) => {
  switch (method) {
    case 'level': return 'success'
    case 'tm': return 'warning'
    case 'hm': return 'danger'
    case 'breed': return 'info'
    case 'tutor': return 'primary'
    default: return ''
  }
}

// 获取学习方式文本
const getLearnMethodText = (method) => {
  switch (method) {
    case 'level': return '升级'
    case 'tm': return 'TM'
    case 'hm': return 'HM'
    case 'breed': return '遗传'
    case 'tutor': return '教学'
    default: return method
  }
}

// 监听搜索输入，实现实时搜索（仅技能名称搜索）
watch(searchQuery, () => {
  if (searchType.value === 'skill' && searchQuery.value.trim() === '') {
    handleSearch()
  }
})

// 组件挂载时获取数据
onMounted(() => {
  fetchSkillsList()
})
</script>

<style scoped>
.skills-page {
  min-height: 100vh;
  background-image: url('@/assets/bk_img01.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 20px;
  position: relative;
}

.skills-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(1px);
  z-index: 0;
}

.skills-page > * {
  position: relative;
  z-index: 1;
}

/* 页面标题 */
.page-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
}

.page-title {
  font-size: 3.5rem;
  font-weight: bold;
  color: #2c3e50;
  margin: 0 0 15px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  font-size: 1.3rem;
  color: #34495e;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 搜索和筛选区域 */
.search-filter-section {
  max-width: 1200px;
  margin: 0 auto 40px auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.search-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  align-items: center;
}

.search-bar .el-input {
  flex: 1;
  max-width: 500px;
}

.search-type-selector {
  margin-bottom: 15px;
}

.search-type-selector .el-radio-group {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 5px;
}

.search-input {
  margin: 0 15px;
}

.search-btn {
  min-width: 120px;
  border-radius: 25px;
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  font-weight: 600;
  color: #333;
  min-width: 50px;
}

.filter-group .el-select {
  min-width: 150px;
}

/* 结果信息 */
.result-info {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #2c3e50;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.result-count strong {
  color: #e74c3c;
}

.search-info {
  margin-left: 20px;
}

/* 技能表格容器 */
.skills-table-container {
  width: 100%;
  margin: 0 auto 40px auto;
  padding: 0 10px;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 表格样式 */
.skills-table {
  --el-table-header-bg-color: #f5f7fa;
  --el-table-header-text-color: #303133;
  --el-table-row-hover-bg-color: #f0f9ff;
}

.skills-table .el-table__header-wrapper {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.skills-table .el-table__header th {
  background: transparent !important;
  color: white !important;
  font-weight: 600;
  padding: 12px 0;
  border-bottom: none;
  text-align: center;
}

.skills-table .el-table__row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.skills-table .el-table__row:hover {
  background-color: #f0f9ff !important;
}

.skills-table .el-table__row td {
  padding: 10px 0;
  vertical-align: middle;
}

/* 表格单元格样式 */
.skill-name-cell {
  font-weight: 600;
  color: #303133;
}

.skill-name-text {
  font-size: 14px;
}

.japanese-name, .english-name {
  font-size: 13px;
  color: #606266;
}

.table-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-align: center;
  min-width: 40px;
}

.power-value, .accuracy-value {
  font-weight: 600;
  color: #409eff;
}

.learn-level {
  color: #67c23a;
  font-weight: 600;
}

.no-level {
  color: #c0c4cc;
}

.description-cell {
  font-size: 13px;
  line-height: 1.4;
  color: #606266;
  max-width: 300px;
}

/* 移除旧的卡片样式，保留表格样式 */

.type-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.type-badge.large {
  padding: 6px 16px;
  font-size: 0.9rem;
  margin-right: 10px;
}

.category-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.category-badge.large {
  padding: 6px 16px;
  font-size: 0.9rem;
}

.category-物理 { background: #C92A2A; }
.category-特殊 { background: #7048E8; }
.category-变化 { background: #495057; }

/* 属性类型颜色 */
.type-草 { background: #7AC74C; }
.type-火 { background: #EE8130; }
.type-水 { background: #6390F0; }
.type-电 { background: #F7D02C; color: #333; }
.type-超能力 { background: #F95587; }
.type-冰 { background: #96D9D6; }
.type-龙 { background: #6F35FC; }
.type-恶 { background: #705746; }
.type-妖精 { background: #D685AD; }
.type-格斗 { background: #C22E28; }
.type-毒 { background: #A33EA1; }
.type-地面 { background: #E2BF65; }
.type-飞行 { background: #A98FF3; }
.type-虫 { background: #A6B91A; }
.type-岩石 { background: #B6A136; }
.type-幽灵 { background: #735797; }
.type-钢 { background: #B7B7CE; }
.type-一般 { background: #A8A878; }

.skill-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 600;
}

.stat-value {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
}

.skill-learn-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.learn-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #555;
}

.learn-label {
  font-weight: 600;
  color: #333;
}

.learn-value {
  color: #667eea;
  font-weight: bold;
}

.skill-description {
  margin-top: 15px;
}

.skill-description p {
  margin: 0;
  color: #666;
  line-height: 1.5;
  font-size: 0.9rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
}

.empty-state p {
  margin: 0 0 20px 0;
  opacity: 0.8;
}

/* 分页 */
.pagination-section {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

:deep(.el-pagination) {
  --el-pagination-bg-color: rgba(255, 255, 255, 0.9);
  --el-pagination-text-color: #333;
  --el-pagination-border-radius: 10px;
}

/* 详情对话框 */
.skill-detail {
  padding: 20px;
}

.detail-header {
  margin-bottom: 25px;
}

.detail-basic {
  text-align: center;
}

.detail-name {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  margin: 0 0 15px 0;
}

.detail-types {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.detail-description,
.detail-effect {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.detail-description h4,
.detail-effect h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.1rem;
}

.detail-description p,
.detail-effect p {
  margin: 0;
  line-height: 1.6;
  color: #555;
}

.detail-stats {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row .stat-label {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.stat-row .stat-value {
  color: #667eea;
  font-weight: bold;
  font-size: 1rem;
}

.reset-info-btn {
  color: white !important;
}

.reset-primary-btn {
  color: white !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .page-title {
    font-size: 2.5rem;
  }
  
  .search-bar {
    flex-direction: column;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    justify-content: space-between;
  }
  
  .skills-table-container {
    margin: 0 10px 40px 10px;
    padding: 0 10px;
  }
  
  .result-info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    margin: 0 10px 20px 10px;
  }
  
  .skills-table .el-table__header th {
    padding: 8px 0;
    font-size: 12px;
  }
  
  .skills-table .el-table__row td {
    padding: 8px 0;
  }
}

@media (max-width: 480px) {
  .skills-table-container {
    margin: 0 5px 40px 5px;
    padding: 0 5px;
  }
  
  .search-filter-section {
    margin: 0 10px 20px 10px;
    padding: 20px;
  }
  
  .skills-table .el-table__header th {
    padding: 6px 0;
    font-size: 11px;
  }
  
  .skills-table .el-table__row td {
    padding: 6px 0;
  }
  
  .table-badge {
    font-size: 10px;
    padding: 1px 6px;
  }
}
</style>